﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace T.FAS.Runtime.Base.Entity
{
    [DataContract]
    [Serializable]
    [JsonConverter(typeof(AbsElementJsonConverter))]
    public class Filter : AbsElement
    {
        [DataMember]
        public override string ElementType { get { return "Filter"; } }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string Code { get; set; }
        [DataMember]
        public string Condition { get; set; }
        [DataMember]
        public string DataType { get; set; }
        [DataMember]
        public List<string> Value { get; set; }
        [DataMember]
        public AdvancedQueryValueType ValueType { get; set; }
        [DataMember]
        public string ValueName { get; set; }

        public override string ToDisplayString() { return "(" + Code +" " + Condition + " " + Value + ")"; }
        public override string ToValueString() { return "(" + Name + " " + Condition + " " + Value + ")"; }

    }

    /// <summary>
    /// 高级查询值类型 0：值类型  1：列名
    /// </summary>
    public enum AdvancedQueryValueType
    {
        Value = 0,
        Column = 1,
    }
}
